<?php $tpl->addCSS('css/product.css'); ?>
<?php $tpl->headInject('<link rel="stylesheet" type="text/css" href="catalog/javascript/jquery/thickbox/thickbox.css" media="screen" />'); ?>
<?php $tpl->addJS('jquery/thickbox/thickbox-compressed.js'); ?>

<div id="product" class="ajaxadd">

  <h2 class="left"><?php echo $heading_title; ?></h2>
  
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
      <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
	  <input type="hidden" name="min_qty" value="<?php echo $min_qty; ?>" />
	  
	  <div class="a">
	    <div>
	      <a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="thickbox">
	      <img id="img_<?php echo $product_id; ?>" src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
	    </div><br />
		<?php echo $text_enlarge; ?>
	  </div>
	    
	  <div class="b">
	    <h3><span class="reduce"><?php echo @$price_old; ?></span>&nbsp;<span class="price"><?php echo $price; ?></span></h3>
	    <h4>Specs</h4>
	    <ul>
	      <li><strong><?php echo $text_stock; ?> </strong><?php echo @$stock; ?></li>
	      <li><strong><?php echo $text_model; ?> </strong><?php echo @$model; ?></li>
	      <li><strong><?php echo $text_weight; ?> </strong><?php echo @$weight; ?></li>
	      <li><strong><?php echo $text_rating; ?> </strong><a href="<?php echo $review; ?>"><img src="<?php echo $tpl->getImage('image/stars_' . $rating . '.png'); ?>" alt="<?php echo $text_rating_stars; ?>" /></a></li>
	    </ul>

  
      	<?php if ($options) { ?>
      	<p><strong><?php echo $text_options; ?></strong></p>
      	<ul>
        	<?php foreach ($options as $option) { ?>
        	<li>
          	<strong><?php echo $option['name']; ?>: </strong>
          	<select name="option[<?php echo $option['option_id']; ?>]">
              <?php foreach ($option['value'] as $option_value) { ?>
              <option value="<?php echo $option_value['product_to_option_id']; ?>"><?php echo $option_value['name']; ?>
              <?php if ($option_value['price']) { ?> 
              <?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
              <?php } ?>
              </option>
              <?php } ?>
          	</select>
          </li>
          <?php } ?>
      	</ul>
    	<?php } ?>
    
    	<table>
      	  <?php if ($min_qty > '1') { ?>
      	  <tr><td colspan="2"><b><?php echo $text_min_qty; ?><?php echo $min_qty; ?></b></td></tr>
      	  <?php } ?>
          <tr>
            <td align="left"><input style="height: 19px; font-size: 17px;" type="text" name="quantity" value="<?php echo $min_qty; ?>" size="3" />&nbsp;x</td>
            <td align="left"><input type="image" title="<?php echo $text_add_to_cart; ?>" alt="<?php echo $text_add_to_cart; ?>" src="<?php echo $tpl->getImage('image/button_add_to_cart.gif'); ?>" /></td>
          </tr>
        </table>
      </div> 
  </form>
  
  <br style="clear:both" />
  
  <div class="c"><?php echo @$description; ?></div>
   
  <?php if ($images) { ?>
  <h2><?php echo $text_images; ?></h2>
  <div class="d"> 
	<ul class="hoverbox">
	  <?php foreach ($images as $key => $image) { ?>
	  <li>
	    <a href="<?php echo $image['popup']; ?>" title="<?php echo $image['title']; ?>" class="thickbox"><img alt="description" src="<?php echo $image['thumb']; ?>"/><img class="preview" alt="description" src="<?php echo $image['thumb']; ?>"/></a>
	  </li>
	  <?php } ?>
	</ul>
  </div>
  <?php } ?>
  <br style="clear:both" />
    
  <?php if ($related) { ?>
  <h2><?php echo $text_related; ?></h2>
  <div class="e"> 
    <ul>
      <?php foreach ($related as $key => $r) { ?>
      <li class="image">
        <a href="<?php echo $r['href']; ?>" title="<?php echo $r['title']; ?>"><img src="<?php echo $r['thumb']; ?>" title="<?php echo $r['title']; ?>" alt="<?php echo $r['title']; ?>" /></a>
        <br /><?php echo $r['title']; ?>
      </li>
      <?php if ($key != (count($related)-1)) { ?><li class="separator"></li><?php } ?>
      <?php } ?>
    </ul>
  </div>
  <?php } ?>
<br style="clear:both" />

  <?php if ($product_discounts){ ?>
    <h2><?php echo $text_qty_discount; ?></h2>
    <div class="f"> 
	<table id="qty_discount" align="center" width="100%" style="border: 1px solid #000;">
	  <tr>
	    <th width="60px" align="center" style="background: #eee; border: 1px solid #000;"><strong><?php echo $text_qty; ?></strong></th>
	    <th width="60px" align="center" style="background: #ccc; border: 1px solid #000;"><strong><?php echo $text_rate; ?></strong></th>
	    <th width="60px" align="center" style="background: #ccc; border: 1px solid #000;"><strong><?php echo $text_disc; ?></strong></th>
	  </tr>
	  <?php foreach ($product_discounts as $product_discount){ ?>
	  <tr>
	    <td width="60px" align="center" style="background: #eee; border: 1px dashed #000;"><?php echo $product_discount['quantity'] . $text_plus;?></td>
		<td width="60px" align="center" style="background: #ccc; border: 1px dashed #000;"><?php echo $product_discount['rate'];?></td>
		<td width="60px" align="center" style="background: #ccc; border: 1px dashed #000;"><?php echo $product_discount['disc'];?></td>
	  </tr>
	  <?php } ?>
	</table>
    </div>
  <?php } ?>
</div> 